package com.jiulan.hearthearing.ui.school.adapter;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.jiulan.hearthearing.R;
import com.jiulan.hearthearing.ui.school.model.SchoolModel;
import com.shehuan.niv.NiceImageView;

import java.util.List;

public class SchoolMovieAdapter extends BaseQuickAdapter<SchoolModel.DataBean.DianyingBean, BaseViewHolder> {

    public SchoolMovieAdapter(List<SchoolModel.DataBean.DianyingBean> data) {
        super(R.layout.item_school_movie, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, SchoolModel.DataBean.DianyingBean item) {
        NiceImageView nivPic = helper.getView(R.id.nivPic);
        Glide.with(mContext).asBitmap().load(item.getImage()).override(170, 80).centerCrop().into(nivPic);
        helper.setText(R.id.tvTitle, item.getTitle());
        helper.setText(R.id.tvContent, item.getShortX());
        helper.setText(R.id.tvCheck, String.valueOf(item.getView()));
        helper.addOnClickListener(R.id.tvWatch);
    }
}
